# my_custom/mcp_module.py
class CustomMCP:
    def __init__(self, name: str, max_workers: int, **kwargs):
        self.name = name
        self.worker_pool = WorkerPool(max_workers)
        
    def start(self):
        self.worker_pool.activate()
        print(f"[{self.name}] Service started")

    def launch_task(self, task_id: str, params: dict):
        """自定义任务启动方法"""
        return self.worker_pool.dispatch_task(task_id, params)

    def get_metrics(self):
        """自定义指标收集"""
        return {
            "active_workers": self.worker_pool.active_count,
            "queue_size": self.worker_pool.queue_size
        }
